{% extends 'account/account_base.html' %}

{% block htmltitle %}登陆{% endblock %}

{% block base_htmlhead %}
    {% load html_tools %}

    {{ 'account/account.css' | as_css }}
    {{ 'flexSelect/flexselect.css' | as_css }}

    {{ 'jQuery/jquery-1.11.0.min.js' | as_js }}
    {{ 'flexSelect/liquidmetal.js' | as_js }}
    {{ 'flexSelect/jquery.flexselect.js' | as_js }}

    {{ 'artDialog/v4/artDialog.js'    | as_js  }}
    {{ 'artDialog/v4/skins/opera.css' | as_css }}
    {{ 'artDialog/popupBox.css'       | as_css }}
{% endblock %}

{% block main_container %}
<div class="container" style="margin:50px 0px;">
    {% if next %}
    <form action="{% url 'account:signin' %}?next={{ next }}" method="POST" >
    {% else %}
    <form action="{% url 'account:signin' %}" method="POST" >
    {% endif %}
    {% csrf_token %}
        <div class="line_container">
            <label class="sign_in_label">部门</label>
            {{ form.username }}
        </div>
        <div class="error" style="margin-left:50%">
            {% for error in form.username.errors %}
                {{ error }}&nbsp;
            {% endfor %}
        </div>
        <div class="line_container">
            <label class="sign_in_label">密码</label>
            {{ form.password }}
        </div> 
        <div class="error" style="margin-left:50%">
            {% for error in form.password.errors %}
                {{ error }}&nbsp;
            {% endfor %}
        </div>
        
        <div class="error" style="margin-left:50%">
            {% for error in form.non_field_errors %}
                {{ error }}&nbsp;
            {% endfor %}
        </div>
        <input type="submit" value="登陆" style="margin:20px 0px 0px 455px" /> 
        &nbsp;
        <a href="{% url 'account:signup' %}">还没有帐号？</a>
        &nbsp;
        <a href="javascript: ;" id="forgetPass">忘记密码？</a>
    </form>
</div> 
<script>
    $(function() {
      $("#id_username").addClass('flexselect').flexselect();
      $('#forgetPass').click(function(){
        var artDlgBox;
        try{
            artDlgBox = art;
        }
        catch( err ){
            console.log( "ArtDialog not found." );  
        }

        var dialog = artDlgBox.dialog({
                      title: "忘记密码肿么办？",
                    content: "请到&nbsp;学生活动中心1楼-学生事物服务中心，寻找&nbsp;<b><u>刘帅&nbsp;老师</u></b>&nbsp;重置密码。",

                      width: 400,
                     height: 200,

                       lock: true,
                     button: [{
                                name: "我知道了",
                            callback: function(){ this.close() },
                     }],
                });
      });
    });
</script>
{% endblock %}
